/* const nums = [3, 5, 2, 4, 54];
const target = 54;
let isFind = false;
console.log(nums.includes(target));

for (let i = 0; i < nums.length; i++) {
  if (nums[i] === target) {
    isFind = true;
    break;
  }
}

if (isFind) {
  console.log("找到了");
} else {
  console.log("没有找到");
} */

/* const nums = [3, 5, 2, 4, 11];
const target = 54;
let index = -1;
console.log(nums.indexOf(target));
for (let i = 0; i < nums.length; i++) {
  if (nums[i] === target) {
    index = i;
    break;
  }
}

console.log(index); */

const nums = [3, 5, 2, 4, 11];
const nums2 = [2, 4, 232, 8, 0];
console.log(
  nums.find((v) => v % 2 === 1) + nums.reverse().find((v) => v % 2 === 1)
);

console.log(
  nums.find((v) => v % 2 === 1) && nums2.find((v) => v % 2 === 1) ? "是" : "否"
);
